package com.kuang.demo.controller.wx;

import com.kuang.demo.bean.BaseRespVo;
import com.kuang.demo.service.wx.WxBrandService;
import com.kuang.demo.vo.wx.WxQueryBrandDetailVO;
import com.kuang.demo.vo.wx.WxQueryBrandListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by 郭浩 on 2020/11/5 15:07
 */
@RestController
@RequestMapping("wx/brand")
public class WxBrandController {

    @Autowired
    WxBrandService wxBrandService;
    @GetMapping("list")
    //Request URL: http://182.92.235.201:8083/wx/brand/list?page=1&size=10
    public BaseRespVo brandList(Integer page,Integer size){

        WxQueryBrandListVO wxQueryBrandListVO = wxBrandService.querybandList(page,size);

        return BaseRespVo.ok(wxQueryBrandListVO);
    }

    @GetMapping("detail")
    public BaseRespVo brandDetail(Integer id){
        WxQueryBrandDetailVO wxQueryBrandDetailVO = wxBrandService.queryBrandDetail(id);
        return BaseRespVo.ok(wxQueryBrandDetailVO);
    }
}
